﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/_LayoutMain.cshtml";
}
<script src="~/scripts/md5.js"></script>
<script type="text/javascript">
    function clearForm() {
        $('#ff').form('clear');
    }

    function submitForm() {
        var name = $('#tbname').textbox('getValue');
        var psd = $('#tbpsd').textbox('getValue');
        if (name == '' || psd == '') {
            return false;
        }
        $('#ff').form('submit', {
            url: '/Login/Check',
            onSubmit: function () {
                $('#tbpsd').textbox('setValue', hex_md5(psd));
            },
            success: function (data) {
                var data = eval('(' + data + ')');
                if (data.code == 200) {
                    window.location.href = '/Default/Index';
                } else {
                    $.messager.alert('提示', data.info, 'info');
                }
            }
        });
    }
</script>
<div style="padding:80px;">
    <div class="easyui-panel" title="网盘登录" style="width:420px;height:300px;padding:40px;">
        <form id="ff" method="post">
            <div style="margin-bottom:20px">
                <input id="tbname" class="easyui-textbox" name="name" style="width:100%" data-options="label:'用户名:',required:true,prompt:'请输入用户名'">
            </div>
            <div style="margin-bottom:20px">
                <input id="tbpsd" class="easyui-textbox" name="password" style="width:100%" data-options="label:'密码:',required:true,type:'password',prompt:'请输入密码'">
            </div>
        </form>
        <div style="text-align:center;padding:5px 0">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">登录</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">清除</a>
        </div>
    </div>
</div>
